from django.contrib.auth.mixins import LoginRequiredMixin
from django import http
from django.views import View

from utils.errmsg_info import error_no, error_msg


class LoginRequiredJsonMixin(LoginRequiredMixin, View):
    def handle_no_permission(self):
        return http.JsonResponse({'errno': error_no['SESSIONERR'], 'errmsg': error_msg['SESSIONERR']})

